package cn.lyq.card.ui.qualified

import androidx.lifecycle.MutableLiveData
import cn.lyq.card.base.SimpleVM


class CashBackVM : SimpleVM() {

    var goodsId = MutableLiveData<Int>()

    val pageSize = 20

    fun getCashBackStageList(index: Int) = simpleEmit {
        repository.achievementService.getCashBack(index + 1, goodsId.value ?: 0)
    }

    fun getCashBackDetail(index: Int, goodsId: Int, page: Int) = simpleEmit {
        repository.achievementService.getCashBackDetail(index + 1, goodsId, page, pageSize)
    }

    fun getDeviceList() = simpleEmit {
        repository.homeService.getGoods()
    }
}